Skip to content

Fix EncryptedValue handling in lookup adapter forms (7.0)#25351

Open
danotorrey wants to merge 7 commits into7.0from
backport/fix-encrypted-value-7.0
Open

Fix EncryptedValue handling in lookup adapter forms (7.0)#25351
danotorrey wants to merge 7 commits into7.0from
backport/fix-encrypted-value-7.0

Conversation

@danotorrey
Copy link
Contributor

@danotorrey danotorrey commented Mar 17, 2026

Summary

  • Backport of PR Fix EncryptedValue handling in lookup adapters #25244 from master to 7.0
  • Fixes EncryptedValue serialization in lookup adapter forms (frontend)
  • Fixes backend: merge EncryptedValue fields on adapter update via prepareConfigUpdate()
  • Removes unnecessary useMemo wrappers
  • Adds type for nextUserPassword

/prd Graylog2/graylog-plugin-enterprise#13548

Cherry-picked commits

  • 7c44372e5f — Fix EncryptedValue serialization in lookup adapter forms
  • cc652ca132 — Add changelog
  • f09c500eed — Fix backend: merge EncryptedValue fields on adapter update
  • 5674609594 — Remove unnecessary useMemo
  • 06a86a0074 — Add type for nextUserPassword

Test plan

  • Verify lookup adapter create/edit forms handle EncryptedValue fields correctly
  • Verify GreyNoise adapter API key is preserved on update
  • Run existing adapter tests

🤖 Generated with Claude Code

danotorrey and others added 5 commits March 17, 2026 15:07
Add `prepareConfig` plugin hook to transform EncryptedValue fields
before they enter Formik state. This prevents the auto-validation
useEffect from sending raw `{"is_set": true}` to the server, which
fails deserialization.

The Formik migration in AdapterFormFields introduced a validation
useEffect that fires before child fieldset effects can convert
encrypted values. Moving the conversion to a synchronous useMemo
in AdapterForm ensures values are transformed before any validation.
The LookupTableResource.updateAdapter() method was saving adapter configs
directly without merging EncryptedValue fields. When the client sent
{"keep_value": true}, the value was lost because the existing encrypted
value was never fetched from the database.

Add prepareConfigUpdate() to LookupDataAdapterConfiguration following the
same pattern as EventNotificationConfig.prepareConfigUpdate(). Override it
in GreyNoiseQuickIPDataAdapter.Config to preserve api_token on update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danotorrey danotorrey changed the title Backport: Fix EncryptedValue handling in lookup adapter forms Fix EncryptedValue handling in lookup adapter forms (7.0) Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant